﻿namespace HutongGames.PlayMakerEditor
{
    using HutongGames.PlayMaker;
    using System;
    using System.Collections.Generic;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using UnityEditor;
    using UnityEngine;

    public class FsmVariable : IComparable
    {
        [CompilerGenerated]
        private NamedVariable NamedVar__BackingField;
        [CompilerGenerated]
        private System.Type ObjectType__BackingField;
        [CompilerGenerated]
        private VariableType Type__BackingField;
        [CompilerGenerated]
        private string TypeName__BackingField;
        private UnityEngine.Object owner;
        private bool ownerIsPrefab;
        public static GUIContent[] VariableTypeNames = new GUIContent[] { new GUIContent("Float"), new GUIContent("Int"), new GUIContent("Bool"), new GUIContent("GameObject"), new GUIContent("String"), new GUIContent("Vector3"), new GUIContent("Color"), new GUIContent("Rect"), new GUIContent("Material"), new GUIContent("Texture"), new GUIContent("Quaternion"), new GUIContent("Object") };

        public FsmVariable(UnityEngine.Object owner, FsmBool fsmBool)
        {
            this.Owner = owner;
            this.NamedVar = fsmBool;
            this.Type = VariableType.Bool;
            this.BoolValue = fsmBool.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmColor fsmColor)
        {
            this.Owner = owner;
            this.NamedVar = fsmColor;
            this.Type = VariableType.Color;
            this.ColorValue = fsmColor.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmFloat fsmFloat)
        {
            this.Owner = owner;
            this.NamedVar = fsmFloat;
            this.Type = VariableType.Float;
            this.FloatValue = fsmFloat.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmGameObject fsmGameObject)
        {
            this.Owner = owner;
            this.NamedVar = fsmGameObject;
            this.Type = VariableType.GameObject;
            this.GameObject = fsmGameObject.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmInt fsmInt)
        {
            this.Owner = owner;
            this.NamedVar = fsmInt;
            this.Type = VariableType.Int;
            this.IntValue = fsmInt.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmMaterial fsmObject)
        {
            this.Owner = owner;
            this.NamedVar = fsmObject;
            this.Type = VariableType.Material;
            this.ObjectValue = fsmObject.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmObject fsmObject)
        {
            this.Owner = owner;
            this.NamedVar = fsmObject;
            this.Type = VariableType.Object;
            this.TypeName = fsmObject.TypeName;
            this.ObjectType = FsmUtility.GetType(this.TypeName);
            this.ObjectValue = fsmObject.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmQuaternion fsmQuaternion)
        {
            this.Owner = owner;
            this.NamedVar = fsmQuaternion;
            this.Type = VariableType.Quaternion;
            this.QuaternionValue = fsmQuaternion.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmRect fsmRect)
        {
            this.Owner = owner;
            this.NamedVar = fsmRect;
            this.Type = VariableType.Rect;
            this.RectValue = fsmRect.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmString fsmString)
        {
            this.Owner = owner;
            this.NamedVar = fsmString;
            this.Type = VariableType.String;
            this.StringValue = fsmString.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmTexture fsmObject)
        {
            this.Owner = owner;
            this.NamedVar = fsmObject;
            this.Type = VariableType.Texture;
            this.ObjectValue = fsmObject.Value;
        }

        public FsmVariable(UnityEngine.Object owner, FsmVector3 fsmVector3)
        {
            this.Owner = owner;
            this.NamedVar = fsmVector3;
            this.Type = VariableType.Vector3;
            this.Vector3Value = fsmVector3.Value;
        }

        public static void AddVariable(FsmVariables variables, VariableType type, string name)
        {
            switch (type)
            {
                case VariableType.Float:
                    variables.FloatVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmFloat>(variables.FloatVariables, new FsmFloat(name));
                    return;

                case VariableType.Int:
                    variables.IntVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmInt>(variables.IntVariables, new FsmInt(name));
                    return;

                case VariableType.Bool:
                    variables.BoolVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmBool>(variables.BoolVariables, new FsmBool(name));
                    return;

                case VariableType.GameObject:
                    variables.GameObjectVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmGameObject>(variables.GameObjectVariables, new FsmGameObject(name));
                    return;

                case VariableType.String:
                    variables.StringVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmString>(variables.StringVariables, new FsmString(name));
                    return;

                case VariableType.Vector3:
                    variables.Vector3Variables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmVector3>(variables.Vector3Variables, new FsmVector3(name));
                    return;

                case VariableType.Color:
                    variables.ColorVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmColor>(variables.ColorVariables, new FsmColor(name));
                    return;

                case VariableType.Rect:
                    variables.RectVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmRect>(variables.RectVariables, new FsmRect(name));
                    return;

                case VariableType.Material:
                    variables.MaterialVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmMaterial>(variables.MaterialVariables, new FsmMaterial(name));
                    return;

                case VariableType.Texture:
                    variables.TextureVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmTexture>(variables.TextureVariables, new FsmTexture(name));
                    return;

                case VariableType.Quaternion:
                    variables.QuaternionVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmQuaternion>(variables.QuaternionVariables, new FsmQuaternion(name));
                    return;

                case VariableType.Object:
                    variables.ObjectVariables = HutongGames.PlayMakerEditor.ArrayUtility.Add<FsmObject>(variables.ObjectVariables, new FsmObject(name));
                    return;
            }
        }

        public static bool CanNetworkSync(NamedVariable variable)
        {
            if (((variable.GetType() != typeof(FsmFloat)) && (variable.GetType() != typeof(FsmInt))) && ((variable.GetType() != typeof(FsmBool)) && (variable.GetType() != typeof(FsmVector3))))
            {
                return (variable.GetType() == typeof(FsmQuaternion));
            }
            return true;
        }

        public static int CompareByType(FsmVariable var1, FsmVariable var2)
        {
            if (var1 == null)
            {
                if (var2 == null)
                {
                    return 0;
                }
                return -1;
            }
            if (var2 == null)
            {
                return 1;
            }
            string strA = var1.Type.ToString();
            string strB = var2.Type.ToString();
            int num = string.Compare(strA, strB, StringComparison.CurrentCulture);
            if (num == 0)
            {
                return var1.CompareTo(var2);
            }
            return num;
        }

        public int CompareTo(object obj)
        {
            FsmVariable variable = obj as FsmVariable;
            if (variable != null)
            {
                return string.Compare(this.Name, variable.Name, StringComparison.CurrentCulture);
            }
            return 0;
        }

        public static void DeleteVariable(FsmVariables variables, FsmVariable fsmVariable)
        {
            if ((variables != null) && (fsmVariable != null))
            {
                switch (fsmVariable.Type)
                {
                    case VariableType.Float:
                        variables.FloatVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmFloat>(variables.FloatVariables, variables.GetFsmFloat(fsmVariable.Name));
                        return;

                    case VariableType.Int:
                        variables.IntVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmInt>(variables.IntVariables, variables.GetFsmInt(fsmVariable.Name));
                        return;

                    case VariableType.Bool:
                        variables.BoolVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmBool>(variables.BoolVariables, variables.GetFsmBool(fsmVariable.Name));
                        return;

                    case VariableType.GameObject:
                        variables.GameObjectVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmGameObject>(variables.GameObjectVariables, variables.GetFsmGameObject(fsmVariable.Name));
                        return;

                    case VariableType.String:
                        variables.StringVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmString>(variables.StringVariables, variables.GetFsmString(fsmVariable.Name));
                        return;

                    case VariableType.Vector3:
                        variables.Vector3Variables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmVector3>(variables.Vector3Variables, variables.GetFsmVector3(fsmVariable.Name));
                        return;

                    case VariableType.Color:
                        variables.ColorVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmColor>(variables.ColorVariables, variables.GetFsmColor(fsmVariable.Name));
                        return;

                    case VariableType.Rect:
                        variables.RectVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmRect>(variables.RectVariables, variables.GetFsmRect(fsmVariable.Name));
                        return;

                    case VariableType.Material:
                        variables.MaterialVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmMaterial>(variables.MaterialVariables, variables.GetFsmMaterial(fsmVariable.Name));
                        return;

                    case VariableType.Texture:
                        variables.TextureVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmTexture>(variables.TextureVariables, variables.GetFsmTexture(fsmVariable.Name));
                        return;

                    case VariableType.Quaternion:
                        variables.QuaternionVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmQuaternion>(variables.QuaternionVariables, variables.GetFsmQuaternion(fsmVariable.Name));
                        return;

                    case VariableType.Object:
                        variables.ObjectVariables = HutongGames.PlayMakerEditor.ArrayUtility.Remove<FsmObject>(variables.ObjectVariables, variables.GetFsmObject(fsmVariable.Name));
                        return;
                }
            }
        }

        public void DoValueGUI([Optional, DefaultParameterValue(null)] GUIContent label, [Optional, DefaultParameterValue(false)] bool isAsset)
        {
            if (this.Owner != null)
            {
                Undo.SetSnapshotTarget(this.Owner, "playMaker : Edit Variable");
            }
            bool changed = GUI.changed;
            GUI.changed = false;
            switch (this.Type)
            {
                case VariableType.Float:
                    if (label == null)
                    {
                        label = new GUIContent("Float Value");
                    }
                    this.FloatValue = EditorGUILayout.FloatField(label, this.FloatValue, new GUILayoutOption[0]);
                    break;

                case VariableType.Int:
                    if (label == null)
                    {
                        label = new GUIContent("Int Value");
                    }
                    this.IntValue = EditorGUILayout.IntField(label, this.IntValue, new GUILayoutOption[0]);
                    break;

                case VariableType.Bool:
                {
                    TrueFalseOption @false = TrueFalseOption.False;
                    if (this.BoolValue)
                    {
                        @false = TrueFalseOption.True;
                    }
                    if (label == null)
                    {
                        label = new GUIContent("Bool Value");
                    }
                    this.BoolValue = ((TrueFalseOption) EditorGUILayout.EnumPopup(label, @false, new GUILayoutOption[0])) == TrueFalseOption.True;
                    break;
                }
                case VariableType.GameObject:
                    if (label == null)
                    {
                        label = new GUIContent("GameObject");
                    }
                    this.GameObject = (UnityEngine.GameObject) EditorGUILayout.ObjectField(label, this.GameObject, typeof(UnityEngine.GameObject), !isAsset && !this.ownerIsPrefab, new GUILayoutOption[0]);
                    break;

                case VariableType.String:
                    if (label == null)
                    {
                        label = new GUIContent("String");
                    }
                    this.StringValue = EditorGUILayout.TextField(label, this.StringValue, new GUILayoutOption[0]);
                    break;

                case VariableType.Vector3:
                    if (label == null)
                    {
                        label = new GUIContent("Vector3");
                    }
                    this.Vector3Value = EditorGUILayout.Vector3Field(label.text, this.Vector3Value, new GUILayoutOption[0]);
                    break;

                case VariableType.Color:
                    if (label == null)
                    {
                        label = new GUIContent("Color");
                    }
                    this.ColorValue = EditorGUILayout.ColorField(label, this.ColorValue, new GUILayoutOption[0]);
                    break;

                case VariableType.Rect:
                    if (label == null)
                    {
                        label = new GUIContent("Rect");
                    }
                    this.RectValue = EditorGUILayout.RectField(label, this.RectValue, new GUILayoutOption[0]);
                    break;

                case VariableType.Material:
                    if (label == null)
                    {
                        label = new GUIContent("Material");
                    }
                    this.ObjectValue = EditorGUILayout.ObjectField(label, this.ObjectValue, typeof(Material), !isAsset && !this.ownerIsPrefab, new GUILayoutOption[0]);
                    break;

                case VariableType.Texture:
                    if (label == null)
                    {
                        label = new GUIContent("Texture");
                    }
                    this.ObjectValue = EditorGUILayout.ObjectField(label, this.ObjectValue, typeof(Texture), !isAsset && !this.ownerIsPrefab, new GUILayoutOption[0]);
                    break;

                case VariableType.Quaternion:
                {
                    if (label == null)
                    {
                        label = new GUIContent("Quaternion");
                    }
                    Vector3 euler = EditorGUILayout.Vector3Field(label.text, this.QuaternionValue.eulerAngles, new GUILayoutOption[0]);
                    if (euler != this.QuaternionValue.eulerAngles)
                    {
                        this.QuaternionValue = Quaternion.Euler(euler);
                    }
                    break;
                }
                case VariableType.Object:
                    GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    GUILayout.Space(6f);
                    GUILayout.Label("Object Type", new GUILayoutOption[] { GUILayout.MaxWidth(94f) });
                    if (GUILayout.Button(this.TypeName, EditorStyles.popup, new GUILayoutOption[0]))
                    {
                        FsmEditorUtility.GenerateObjectTypesMenu(this).ShowAsContext();
                    }
                    GUILayout.EndHorizontal();
                    if (label == null)
                    {
                        label = new GUIContent("Object Value");
                    }
                    this.ObjectValue = EditorGUILayout.ObjectField(label, this.ObjectValue, this.ObjectType ?? typeof(UnityEngine.Object), !isAsset && !this.ownerIsPrefab, new GUILayoutOption[0]);
                    break;
            }
            if (GUI.changed)
            {
                this.UpdateVariableValue();
                if (this.Owner != null)
                {
                    if (this.Owner is PlayMakerGlobals)
                    {
                        FsmEditor.SaveGlobals();
                    }
                    else
                    {
                        FsmEditor.SetFsmDirty((bool) this.Owner, false);
                    }
                }
            }
            GUI.changed = changed;
        }

        public bool Equals(FsmVariable other)
        {
            if (object.ReferenceEquals(null, other))
            {
                return false;
            }
            return (object.ReferenceEquals(this, other) || object.Equals(other.Name, this.Name));
        }

        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(null, obj))
            {
                return false;
            }
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            if (obj.GetType() != typeof(FsmVariable))
            {
                return false;
            }
            return this.Equals((FsmVariable) obj);
        }

        public static List<FsmVariable> GetFsmVariableList(FsmVariables variables, [Optional, DefaultParameterValue(null)] UnityEngine.Object owner)
        {
            List<FsmVariable> list = new List<FsmVariable>();
            if (variables != null)
            {
                foreach (FsmObject obj2 in variables.ObjectVariables)
                {
                    list.Add(new FsmVariable(owner, obj2));
                }
                foreach (FsmMaterial material in variables.MaterialVariables)
                {
                    list.Add(new FsmVariable(owner, material));
                }
                foreach (FsmTexture texture in variables.TextureVariables)
                {
                    list.Add(new FsmVariable(owner, texture));
                }
                foreach (FsmFloat num in variables.FloatVariables)
                {
                    list.Add(new FsmVariable(owner, num));
                }
                foreach (FsmInt num2 in variables.IntVariables)
                {
                    list.Add(new FsmVariable(owner, num2));
                }
                foreach (FsmBool @bool in variables.BoolVariables)
                {
                    list.Add(new FsmVariable(owner, @bool));
                }
                foreach (FsmString str in variables.StringVariables)
                {
                    list.Add(new FsmVariable(owner, str));
                }
                foreach (FsmGameObject obj3 in variables.GameObjectVariables)
                {
                    list.Add(new FsmVariable(owner, obj3));
                }
                foreach (FsmVector3 vector in variables.Vector3Variables)
                {
                    list.Add(new FsmVariable(owner, vector));
                }
                foreach (FsmRect rect in variables.RectVariables)
                {
                    list.Add(new FsmVariable(owner, rect));
                }
                foreach (FsmQuaternion quaternion in variables.QuaternionVariables)
                {
                    list.Add(new FsmVariable(owner, quaternion));
                }
                foreach (FsmColor color in variables.ColorVariables)
                {
                    list.Add(new FsmVariable(owner, color));
                }
            }
            return list;
        }

        public override int GetHashCode()
        {
            if (this.Name == null)
            {
                return 0;
            }
            return this.Name.GetHashCode();
        }

        public static FsmVariable GetVariable(List<FsmVariable> variables, string name)
        {
            foreach (FsmVariable variable in variables)
            {
                if (variable.Name == name)
                {
                    return variable;
                }
            }
            return null;
        }

        public VariableType GetVariableType(NamedVariable variable)
        {
            if (variable.GetType() == typeof(FsmMaterial))
            {
                return VariableType.Material;
            }
            if (variable.GetType() == typeof(FsmTexture))
            {
                return VariableType.Texture;
            }
            if (variable.GetType() == typeof(FsmFloat))
            {
                return VariableType.Float;
            }
            if (variable.GetType() == typeof(FsmInt))
            {
                return VariableType.Int;
            }
            if (variable.GetType() == typeof(FsmBool))
            {
                return VariableType.Bool;
            }
            if (variable.GetType() == typeof(FsmString))
            {
                return VariableType.String;
            }
            if (variable.GetType() == typeof(FsmGameObject))
            {
                return VariableType.GameObject;
            }
            if (variable.GetType() == typeof(FsmVector3))
            {
                return VariableType.Vector3;
            }
            if (variable.GetType() == typeof(FsmRect))
            {
                return VariableType.Rect;
            }
            if (variable.GetType() == typeof(FsmQuaternion))
            {
                return VariableType.Quaternion;
            }
            if (variable.GetType() == typeof(FsmColor))
            {
                return VariableType.Color;
            }
            if (variable.GetType() == typeof(FsmObject))
            {
                return VariableType.Object;
            }
            Debug.LogError("GetVariableType: Unknown Type!");
            return VariableType.Unknown;
        }

        public static VariableType GetVariableType(List<FsmVariable> variables, string name)
        {
            FsmVariable variable = GetVariable(variables, name);
            if (variable != null)
            {
                return variable.Type;
            }
            return VariableType.Unknown;
        }

        public void UpdateVariableValue()
        {
            switch (this.Type)
            {
                case VariableType.Float:
                    ((FsmFloat) this.NamedVar).Value = this.FloatValue;
                    return;

                case VariableType.Int:
                    ((FsmInt) this.NamedVar).Value = this.IntValue;
                    return;

                case VariableType.Bool:
                    ((FsmBool) this.NamedVar).Value = this.BoolValue;
                    return;

                case VariableType.GameObject:
                    ((FsmGameObject) this.NamedVar).Value = this.GameObject;
                    return;

                case VariableType.String:
                    ((FsmString) this.NamedVar).Value = this.StringValue;
                    return;

                case VariableType.Vector3:
                    ((FsmVector3) this.NamedVar).Value = this.Vector3Value;
                    return;

                case VariableType.Color:
                    ((FsmColor) this.NamedVar).Value = this.ColorValue;
                    return;

                case VariableType.Rect:
                    ((FsmRect) this.NamedVar).Value = this.RectValue;
                    return;

                case VariableType.Material:
                    ((FsmMaterial) this.NamedVar).Value = (Material) this.ObjectValue;
                    return;

                case VariableType.Texture:
                    ((FsmTexture) this.NamedVar).Value = (Texture) this.ObjectValue;
                    return;

                case VariableType.Quaternion:
                    ((FsmQuaternion) this.NamedVar).Value = this.QuaternionValue;
                    return;

                case VariableType.Object:
                {
                    FsmObject namedVar = (FsmObject) this.NamedVar;
                    namedVar.Value = this.ObjectValue;
                    namedVar.ObjectType = this.ObjectType;
                    this.ObjectValue = namedVar.Value;
                    return;
                }
            }
        }

        public static bool VariableNameUsed(List<FsmVariable> variables, string name)
        {
            foreach (FsmVariable variable in variables)
            {
                if (variable.Name == name)
                {
                    return true;
                }
            }
            return false;
        }

        public bool BoolValue
        {
            get
            {
                return ((FsmBool) this.NamedVar).Value;
            }
            set
            {
                ((FsmBool) this.NamedVar).Value = value;
            }
        }

        public Color ColorValue
        {
            get
            {
                return ((FsmColor) this.NamedVar).Value;
            }
            set
            {
                ((FsmColor) this.NamedVar).Value = value;
            }
        }

        public float FloatValue
        {
            get
            {
                return ((FsmFloat) this.NamedVar).Value;
            }
            set
            {
                ((FsmFloat) this.NamedVar).Value = value;
            }
        }

        public UnityEngine.GameObject GameObject
        {
            get
            {
                return ((FsmGameObject) this.NamedVar).Value;
            }
            set
            {
                ((FsmGameObject) this.NamedVar).Value = value;
            }
        }

        public int IntValue
        {
            get
            {
                return ((FsmInt) this.NamedVar).Value;
            }
            set
            {
                ((FsmInt) this.NamedVar).Value = value;
            }
        }

        public string Name
        {
            get
            {
                return this.NamedVar.Name;
            }
            set
            {
                this.NamedVar.Name = value;
            }
        }

        public NamedVariable NamedVar
        {
            [CompilerGenerated]
            get
            {
                return this.NamedVar__BackingField;
            }
            [CompilerGenerated]
            set
            {
                this.NamedVar__BackingField = value;
            }
        }

        public bool NetworkSync
        {
            get
            {
                return this.NamedVar.NetworkSync;
            }
            set
            {
                this.NamedVar.NetworkSync = value;
            }
        }

        public System.Type ObjectType
        {
            [CompilerGenerated]
            get
            {
                return this.ObjectType__BackingField;
            }
            [CompilerGenerated]
            set
            {
                this.ObjectType__BackingField = value;
            }
        }

        public UnityEngine.Object ObjectValue
        {
            get
            {
                return ((FsmObject) this.NamedVar).Value;
            }
            set
            {
                ((FsmObject) this.NamedVar).Value = value;
            }
        }

        public UnityEngine.Object Owner
        {
            get
            {
                return this.owner;
            }
            set
            {
                this.owner = value;
                if (this.owner != null)
                {
                    this.ownerIsPrefab = EditorUtility.GetPrefabType(this.owner) == PrefabType.Prefab;
                }
            }
        }

        public Quaternion QuaternionValue
        {
            get
            {
                return ((FsmQuaternion) this.NamedVar).Value;
            }
            set
            {
                ((FsmQuaternion) this.NamedVar).Value = value;
            }
        }

        public Rect RectValue
        {
            get
            {
                return ((FsmRect) this.NamedVar).Value;
            }
            set
            {
                ((FsmRect) this.NamedVar).Value = value;
            }
        }

        public bool ShowInInspector
        {
            get
            {
                return this.NamedVar.ShowInInspector;
            }
            set
            {
                this.NamedVar.ShowInInspector = value;
            }
        }

        public string StringValue
        {
            get
            {
                return ((FsmString) this.NamedVar).Value;
            }
            set
            {
                ((FsmString) this.NamedVar).Value = value;
            }
        }

        public string Tooltip
        {
            get
            {
                return this.NamedVar.Tooltip;
            }
            set
            {
                this.NamedVar.Tooltip = value;
            }
        }

        public VariableType Type
        {
            [CompilerGenerated]
            get
            {
                return this.Type__BackingField;
            }
            [CompilerGenerated]
            set
            {
                this.Type__BackingField = value;
            }
        }

        public string TypeName
        {
            [CompilerGenerated]
            get
            {
                return this.TypeName__BackingField;
            }
            [CompilerGenerated]
            set
            {
                this.TypeName__BackingField = value;
            }
        }

        public Vector3 Vector3Value
        {
            get
            {
                return ((FsmVector3) this.NamedVar).Value;
            }
            set
            {
                ((FsmVector3) this.NamedVar).Value = value;
            }
        }
    }
}

